import sqlite3, hashlib, json, datetime
from django.shortcuts import render
from django.http import HttpResponse
from shared_resources import *

def index(request):
	initialize(request)
	
	output = ""
	if global_vars["environment"] == "qidi" or global_vars["environment"] == "dev":
		output += """
		<script>
			window.location = "/users/";
		</script>
		"""
		
	elif global_vars["environment"] == "demo":
		output += """
 		<html>
		<head>
		<link rel="stylesheet" type="text/css" href="/static/bootstrap/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="/static/style.css" />
		<link rel="stylesheet" type="text/css" href="/static/distro/style_"""+global_vars["environment"]+""".css" />
		<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
		</head>
		<style>
		body {overflow: hidden;}
		.container div {height: 200px;}
		.row {background: grey; margin-left: -20000px; padding-left: 20000px; margin-right: -20000px; padding-right: 20000px;}
		</style>
		<div class="header">
        hello
        </div>
		<div class="container">
			<div class="row">
				<div class="column">
					<h1>We run your tutoring company for you</h1>
				</div>
			</div>
			<div class="row" style="background: yellow;">
				<div class="col-xs-12 col-md-4" style="background: red;">
					<p>Some writing<p>
				</div>
				<div class="col-xs-12 col-md-8" style="background: blue;">
					<p>Some writing<p>
				</div>
			</div>
			<div class="row" style="background: yellow;">
				<div class="col-xs-12 col-md-4 col-md-push-8" style="background: red;">
					<p>Some writing<p>
				</div>
				<div class="col-xs-12 col-md-8 col-md-pull-4" style="background: blue;">
					<p>Some writing<p>
				</div>
			</div>
		</div>
		"""
		
	return HttpResponse(output)
